<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSysUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sys_users', function (Blueprint $table) {
            $table->id();
            $table->integer('dept_id');
            $table->string('username',32)->unique();
            $table->string('nickname');
            $table->string('user_type',2)->default('00');
            $table->string('phonenumber',11)->nullable();;
            $table->string('password');
            $table->tinyInteger('status')->default(0);
            $table->string('login_ip',128)->nullable();
            $table->timestamp('login_time')->nullable();
            $table->integer('create_by')->nullable();
            $table->integer('update_by')->nullable();

            $table->integer('created_at');
            $table->integer('updated_at');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sys_users');
    }
}
